server {

    listen 82;
    server_name 47.103.36.143;

    default_type 'text/html';
    charset utf-8;

    lua_code_cache on;

    autoindex on;


    location /xmpp {
        alias /opt/andrew_git/xmpp/;
        index index.html;
    }

    location /pic/ {
        add_header 'Access-Control-Allow-Origin' $http_origin  always;
        add_header 'Access-Control-Allow-Credentials' 'true'  always;
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'  always;
        add_header 'Access-Control-Allow-Headers' 'DNT,web-token,app-token,Authorization,Accept,Origin,Keep-Alive,User-Agent,X-Mx-ReqToken,X-Data-Type,X-Auth-Token,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'  always;
        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'  always;
       autoindex on;
        alias /opt/pic/;
    }
   
    location / {
        add_header 'Access‐Control‐Allow‐Origin' '*';
        add_header 'Access‐Control‐Allow‐Credentials' 'true';
        add_header 'Access‐Control‐Allow‐Methods' '*';
        default_type 'text/plain'; 
        proxy_pass http://47.103.36.143:5280/;
    }

}